{include file="public/header,public/nav,public/fixbar" title="<?php echo request()->pc_info['seo_title']?>"/}
<div class="layui-body">
    <div class="layui-container">
        {if $banner_list}
        <div class="layui-main margin-bottom-10" style="padding: 0; background-color: #f2f2f2;;">
            <!-- Banner区域 -->
            <div class="home-banner">
                <div class="layui-col-space25">
                    <div class="layui-col-xs9 layui-col-md9 {if !$banner_side} layui-col-md12 {/if}">
                        <div class="layui-carousel" id="banner-image">
                            <div carousel-item>
                                {foreach $banner_list as $v}
                                    <div><a href="{$v.href ?? 'javascript:;'}"><img src="{$v.img}"></a></div>
                                {/foreach}
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs3 layui-col-md3">
                        <div class="banner-side-list">
                            {foreach $banner_side as $v}
                            <a href="{$v.href ?? 'javascript:;'}" class="link">
                                <img src="{$v.img}" class="image">
                            </a>
                            {/foreach}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {/if}
        <div class="layui-main">
            <!-- 主体区域 -->
            <div class="home-content">
                {if $live_list}
                <div class="layui-row">
                    <div class="home-title">
                        <div class="title">
                            <img src="/static/images/home/title_live_icon.png" class="title-icon">
                            <p class="text">推荐直播</p>
                            <img src="/static/images/home/title_deco.png" class="deco-icon">
                        </div>
                        <a class="more" href="/live/index">
                            <span class="text">更多直播</span>
                            <i class="layui-icon layui-icon-right"></i>
                        </a>
                    </div>
                    <div class="layui-col-space25">
                        {foreach $live_list as $v}
                        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6 layui-col-lg4">
                            <a href="{$v.href}">
                                <div class="layui-card product-item">
                                    <div class="layui-card-header">
                                        <div class="live-time">
                                            <i class="layui-icon layui-icon-group"></i>
                                            <span class="text">{$v.max_users}</span>
                                        </div>
                                    </div>
                                    <div class="layui-card-body">
                                        <div class="live-content">
                                            <img src="{$v.head_imgs}">
                                            <div class="detail">
                                                <div class="live-title">
                                                    {$v.name}
                                                </div>
                                                {if $v.tags}
                                                    <div class="product-tag">
                                                        {$v.tags|raw}
                                                    </div>
                                                {/if}
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-card-footer">
                                        <p class="text">有 <b>{$v.virtual_sales+$v.real_sales}</b>人报名</p>
                                        <p class="product-price">
                                            {if $v.sale_price <= 0}
                                                免费
                                            {else}
                                            <span class="symbol">￥</span>{$v.sale_price}
                                            {/if}
                                        </p>
                                    </div>
                                </div>
                            </a>
                        </div>
                        {/foreach}
                    </div>
                </div>
                {/if}
                {if $question_list}
                <div class="layui-row">
                    <div class="home-title">
                        <div class="title">
                            <img src="/static/images/home/title_question_icon.png" class="title-icon">
                            <p class="text">题库推荐</p>
                            <img src="/static/images/home/title_deco.png" class="deco-icon">
                        </div>
                        <a class="more" href="/question/index">
                            <span class="text">更多题库</span>
                            <i class="layui-icon layui-icon-right"></i>
                        </a>
                    </div>
                    <div class="layui-col-space25">
                        {if $qu_advert}
                        <div class="layui-col-xs12 layui-col-sm6 layui-col-md8 layui-col-lg6">
                            <div class="layui-carousel" id="qu-advert">
                                <div carousel-item>
                                    {foreach $qu_advert as $v}
                                        <div><a href="{$v.href ?? 'javascript:;'}"><img src="{$v.img}"></a></div>
                                    {/foreach}
                                </div>
                            </div>
                        </div>
                        {/if}
                        {foreach $question_list as $v}
                        <div class="layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg3">
                            <a href="{$v.href}">
                                <div class="layui-card product-item">
                                    <div class="layui-card-body">
                                        <div class="course-cover">
                                            <img src="{$v.head_imgs}">
                                        </div>
                                        <div class="detail" style="height: 60px;">
                                            <div class="product-title layui-ellip">
                                                {$v.name}
                                            </div>
                                            {if $v.tags}
                                            <div class="product-tag">
                                                {$v.tags|raw}
                                            </div>
                                            {/if}
                                        </div>
                                    </div>
                                    <div class="layui-card-footer">
                                        <p class="text">已有 <b>{$v.virtual_sales+$v.real_sales}</b>人学习</p>
                                        <p class="product-price">
                                            {if $v.sale_price <= 0}
                                                免费
                                            {else}
                                            <span class="symbol">￥</span>{$v.sale_price}
                                            {/if}
                                        </p>
                                    </div>
                                </div>
                            </a>
                        </div>
                        {/foreach}
                    </div>
                </div>
                {/if}
                {if $course_list}
                <div class="layui-row">
                    <div class="home-title">
                        <div class="title">
                            <img src="/static/images/home/title_course_icon.png" class="title-icon">
                            <p class="text">热门课程</p>
                            <img src="/static/images/home/title_deco.png" class="deco-icon">
                        </div>
                        <a class="more" href="/course/index">
                            <span class="text">更多课程</span>
                            <i class="layui-icon layui-icon-right"></i>
                        </a>
                    </div>
                    <div class="layui-col-space25">
                        {if $course_advert}
                        <div class="layui-col-xs12 layui-col-sm6 layui-col-md8 layui-col-lg6">
                            <div class="layui-carousel" id="course-advert">
                                <div carousel-item>
                                    {foreach $course_advert as $v}
                                        <div><a href="{$v.href ?? 'javascript:;'}"><img src="{$v.img}"></a></div>
                                    {/foreach}
                                </div>
                            </div>
                        </div>
                        {/if}
                        {foreach $course_list as $v}
                        <div class="layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg3">
                            <a href="{$v.href}">
                                <div class="layui-card product-item">
                                    <div class="layui-card-body">
                                        <div class="course-cover">
                                            <img src="{$v.head_imgs}">
                                        </div>
                                        <div class="detail" style="height: 60px;">
                                            <div class="product-title layui-ellip">
                                                {$v.name}
                                            </div>
                                            {if $v.tags}
                                            <div class="product-tag">
                                                {$v.tags|raw}
                                            </div>
                                            {/if}
                                        </div>
                                    </div>
                                    <div class="layui-card-footer">
                                        <p class="text">已有 <b>{$v.virtual_sales+$v.real_sales}</b> 人学习</p>
                                        <p class="product-price">
                                            {if $v.sale_price <= 0}
                                                免费
                                            {else}
                                            <span class="symbol">￥</span>{$v.sale_price}
                                            {/if}
                                        </p>
                                    </div>
                                </div>
                            </a>
                        </div>
                        {/foreach}
                    </div>
                </div>
                {/if}
                {if $goods_list}
                <div class="layui-row">
                    <div class="home-title">
                        <div class="title">
                            <img src="/static/images/home/title_goods_icon.png" class="title-icon">
                            <p class="text">实物推荐</p>
                            <img src="/static/images/home/title_deco.png" class="deco-icon">
                        </div>
                        <a class="more" href="/goods/index">
                            <span class="text">更多实物</span>
                            <i class="layui-icon layui-icon-right"></i>
                        </a>
                    </div>
                    <div class="layui-col-space25">
                        {if $goods_advert}
                        <div class="layui-col-xs12 layui-col-sm6 layui-col-md8 layui-col-lg6">
                            <div class="layui-carousel" id="goods-advert">
                                <div carousel-item>
                                    {foreach $goods_advert as $v}
                                        <div><a href="{$v.href ?? 'javascript:;'}"><img src="{$v.img}"></a></div>
                                    {/foreach}
                                </div>
                            </div>
                        </div>
                        {/if}
                        {foreach $goods_list as $v}
                        <div class="layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg3">
                            <a href="{$v.href}">
                                <div class="layui-card product-item">
                                    <div class="layui-card-body">
                                        <div class="goods-cover">
                                            <img src="{$v.head_imgs}" style="height: 248px;">
                                        </div>
                                        <div class="detail">
                                            <div class="product-title layui-ellip">
                                                {$v.name}
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-card-footer">
                                        <p class="text">已售 <b>{$v.virtual_sales+$v.real_sales}</b></p>
                                        <p class="product-price">
                                            {if $v.sale_price <= 0}
                                                免费
                                            {else}
                                            <span class="symbol">￥</span>{$v.sale_price}
                                            {/if}
                                        </p>
                                    </div>
                                </div>
                            </a>
                        </div>
                        {/foreach}
                    </div>
                </div>
                {/if}
                <!-- 资讯 -->
                {if $article_list}
                <div class="layui-row">
                    <div class="home-title">
                        <div class="title">
                            <img src="/static/images/home/title_news_icon.png" class="title-icon">
                            <p class="text">热门资讯</p>
                            <img src="/static/images/home/title_deco.png" class="deco-icon">
                        </div>
                        <a class="more" href="/article/index">
                            <span class="text">更多资讯</span>
                            <i class="layui-icon layui-icon-right"></i>
                        </a>
                    </div>
                    <div class="layui-col-space25">
                        {foreach $article_list as $v}
                        <div class="layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg4">
                            <a href="/article/detail?id={$v.id}">
                                <div class="layui-card product-item">
                                    <div class="layui-card-body">
                                        <div class="article-content">
                                            <div class="article-cover">
                                                <img src="{$v.img}">
                                            </div>
                                            <div class="detail layui-ellip">
                                                <div class="product-title layui-ellip">{$v.title}</div>
                                                <div class="text" style="margin-top: 10px;">{$v.cat_names|raw}</div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-card-footer">
                                        <p class="text"><i class="layui-icon layui-icon-time"></i> {$v.create_time|date="m月d日 H:i"}</p>
                                        <p class="text"><i class="layui-icon layui-icon-eye"></i> {$v.click_num}</p>
                                    </div>
                                </div>
                            </a>
                        </div>
                        {/foreach}
                    </div>
                </div>
                {/if}
            </div>
        </div>
        
    </div>
</div>

{include file="public/footer"/}
<script type="text/javascript">
    layui.use(function(){
        var carousel = layui.carousel;
        // 渲染 - 图片轮播
        carousel.render({
            elem: '#banner-image',
            width: '100%',
            height: '400px',
            interval: 3000
        });

        // 渲染 - 图片轮播
        carousel.render({
            elem: '#qu-advert',
            width: '100%',
            height: '313px',
            interval: 3000
        });

        // 渲染 - 图片轮播
        carousel.render({
            elem: '#course-advert',
            width: '100%',
            height: '313px',
            interval: 3000
        });

        // 渲染 - 图片轮播
        carousel.render({
            elem: '#goods-advert',
            width: '100%',
            height: '376px',
            interval: 3000
        });
    });
</script>